import { reactive, ref } from 'vue';
import { add, get, remove, update } from '@/services';
import { message, Modal } from 'ant-design-vue';

export default function useDetailModal(url) {
  const detailModalRef = ref(null);

  const showDetailModal = async id => {
    const res = await get(`/api/${url}`, id);
    if (res.success) {
      detailModalRef.value.showDetailModal(res.data);
    }
  };

  return {
    showDetailModal,
    detailModalRef,
  };
}
